package com.sip.stream.gbstack;

import android.util.SparseArray;

public class RetCode {
    public static final int EGSRTP_CONFLICT_NETTYPE = 10012;
    public static final int EGSRTP_NET_CONNECT_BROKEN = 10007;
    public static final int EGSRTP_NET_CONNECT_FAILED = 10008;
    public static final int EGSRTP_NET_INIT_FAIL = 10005;
    public static final int EGSRTP_NET_NO_CONNECTION = 10006;
    public static final int EGSRTP_NET_QOS_NOMATCH = 10014;
    public static final int EGSRTP_NOT_SUPPORT = 10003;
    public static final int EGSRTP_PARAM_ERROR = 10001;
    public static final int EGSRTP_PARAM_INVALID = 10002;
    public static final int EGSRTP_PARAM_SIZE_INVAILD = 10015;
    public static final int EGSRTP_PARAM_ZERO_SSRC = 10016;
    public static final int EGSRTP_PORT_EXHAUSTED = 10004;
    public static final int EGSRTP_REUSE_INVALID = 10017;
    public static final int EGSRTP_RTP_NO_BUFFER = 10010;
    public static final int EGSRTP_RTP_SSRC_EXIST = 10009;
    public static final int EGSRTP_SERVER_BUSY = 10013;
    public static final int EGSRTP_SESSION_NOT_EXIST = 10011;
    public static final int EGSRTP_SUCCESS = 10000;
    public static final int EGSRTP_UNKNOW = 10099;
    public static final int GS28181_ERR_AGENT_NOT_LOGIN = 26;
    public static final int GS28181_ERR_AUTHORIZATION_FAIL = 23;
    public static final int GS28181_ERR_BASIC64_FAILED = 37;
    public static final int GS28181_ERR_CALLBACK_INVALID = 35;
    public static final int GS28181_ERR_CNN_INVALID = 36;
    public static final int GS28181_ERR_CONNECT_FAIL = 42;
    public static final int GS28181_ERR_DATAEMPTY = 2;
    public static final int GS28181_ERR_DATA_INCOMPLETE = 38;
    public static final int GS28181_ERR_DATA_NOTFOUND = 12;
    public static final int GS28181_ERR_DESTINFO_NOT_EXIST = 16;
    public static final int GS28181_ERR_DLG_NOT_EXIST = 17;
    public static final int GS28181_ERR_FAILED = 25;
    public static final int GS28181_ERR_FORMAT_STRING_FAIL = 18;
    public static final int GS28181_ERR_INIT_NCP_FAIL = 3;
    public static final int GS28181_ERR_INTERFACE_INVALID = 27;
    public static final int GS28181_ERR_INTERFACE_NOTEXIST = 34;
    public static final int GS28181_ERR_INVALID_CFG_TYPE = 40;
    public static final int GS28181_ERR_INVALID_HANDLE = 1;
    public static final int GS28181_ERR_INVALID_PARAM_LEN = 41;
    public static final int GS28181_ERR_MANSRTSP_INVALID = 11;
    public static final int GS28181_ERR_MANSRTSP_PACK_FAIL = 30;
    public static final int GS28181_ERR_MESSAGE_SYNC_FAIL = 20;
    public static final int GS28181_ERR_NOT_SUPPORTED = 33;
    public static final int GS28181_ERR_OSIPMSG_INIT_FAIL = 15;
    public static final int GS28181_ERR_OSIP_PACK_FAIL = 13;
    public static final int GS28181_ERR_OSIP_PARSE_FAIL = 14;
    public static final int GS28181_ERR_PARAM_INVALID = 8;
    public static final int GS28181_ERR_RECEIVE_FAILURE = 22;
    public static final int GS28181_ERR_REQ_NOT_FOUND = 4;
    public static final int GS28181_ERR_SDK_AUTH = 44;
    public static final int GS28181_ERR_SDP_INVALID = 10;
    public static final int GS28181_ERR_SERVICE_STOP = 39;
    public static final int GS28181_ERR_STR_TO_XML_FAIL = 5;
    public static final int GS28181_ERR_SUBJECT_INVALID = 9;
    public static final int GS28181_ERR_SUB_NOTEXIST = 32;
    public static final int GS28181_ERR_SUB_TIMEOUT = 31;
    public static final int GS28181_ERR_SUCCESS = 0;
    public static final int GS28181_ERR_TCP_SENDFAILED = 43;
    public static final int GS28181_ERR_UDP_SEND_FAIL = 19;
    public static final int GS28181_ERR_VERIFY_FAILED = 24;
    public static final int GS28181_ERR_WAIT_TIMEOUT = 21;
    public static final int GS28181_ERR_XMLCMD_INVALID = 7;
    public static final int GS28181_ERR_XMLTAG_INVALID = 6;
    public static final int GS28181_ERR_XML_PACK_FAIL = 28;
    public static final int GS28181_ERR_XML_PARSE_FAIL = 29;
    public static final int RTP_TYPE_CODE = 10000;
    static SparseArray<String> map;

    static {
        SparseArray<String> sparseArray = new SparseArray<>();
        map = sparseArray;
        sparseArray.put(0, "操作成功");
        map.put(1, "无效句柄");
        map.put(2, "数据为空");
        map.put(3, "初始化网络接口失败");
        map.put(4, "收到的回复没有找到对应的请求");
        map.put(5, "字符串转换成XML结构失败");
        map.put(6, "XML标签项不可用");
        map.put(7, "XML标签命令错误");
        map.put(8, "参数错误");
        map.put(9, "Sip信息中的Subject头域错误");
        map.put(10, "Sip信息中的SDP内容错误");
        map.put(11, "Sip信息中播放控制命令错误");
        map.put(12, "目标数据未找到");
        map.put(13, "组装sip数据包失败");
        map.put(14, "解析sip数据包失败");
        map.put(15, "osip信息初始化失败");
        map.put(16, "对应的链接信息不存在");
        map.put(17, "历史会话信息不存在");
        map.put(18, "产生发送信息失败");
        map.put(19, "发送UDP数据失败");
        map.put(20, "消息同步处理失败");
        map.put(21, "等待回复超时");
        map.put(22, "接收到错误回复");
        map.put(23, "产生校验信息失败");
        map.put(24, "注册校验失败");
        map.put(25, "操作失败");
        map.put(26, "代理端未登录");
        map.put(27, "接口不可用");
        map.put(28, "封装XML信息失败");
        map.put(29, "解析XML信息失败");
        map.put(30, "封装Mansrtsp信息失败");
        map.put(31, "订阅已过期");
        map.put(32, "订阅信息不存在");
        map.put(33, "协议版本不支持操作");
        map.put(34, "没有该功能");
        map.put(35, "回调函数不可用");
        map.put(36, "链接不可用");
        map.put(37, "生成Basic64数据失败");
        map.put(38, "回复内容不完整");
        map.put(39, "服务已停止");
        map.put(40, "无效配置类型");
        map.put(41, "无效的配置参数长度");
        map.put(42, "建立TCP链接失败");
        map.put(43, "TCP发送失败");
        map.put(44, "设备型号校验不通过");
        map.put(10000, "成功");
        map.put(EGSRTP_PARAM_ERROR, "参数错误");
        map.put(EGSRTP_PARAM_INVALID, "参数异常，一般是传入的句柄或指针为NULL");
        map.put(EGSRTP_NOT_SUPPORT, "不支持的操作");
        map.put(EGSRTP_PORT_EXHAUSTED, "端口区间已用尽");
        map.put(EGSRTP_NET_INIT_FAIL, "网络初始化失败，多数为端口绑定失败");
        map.put(EGSRTP_NET_NO_CONNECTION, "尚没有网络链接，多数TCP被动式时，对端没有connect");
        map.put(EGSRTP_NET_CONNECT_BROKEN, "TCP链接已断开");
        map.put(EGSRTP_NET_CONNECT_FAILED, "向对端connect失败");
        map.put(EGSRTP_RTP_SSRC_EXIST, "该SSRC已存在");
        map.put(10010, "内部缓存不足，主要出现在InputStream的帧没有内存可保存时返回");
        map.put(10011, "该会话句柄已经被释放了");
        map.put(10012, "DupRtpSession传入的网络类型和句柄原有的类型不匹配");
        map.put(10013, "调用SetParameter时，通道已启动，不可设置");
        map.put(10014, "OpenSession时网络类型对应的EnumRtpQosMode不匹配");
        map.put(10015, "SetParameter时，nDataLength的值与设置类型对应结构体的长度不一致");
        map.put(EGSRTP_PARAM_ZERO_SSRC, "当使用端口复用模式时，不允许SSRC为0");
        map.put(10017, "表示不允许进行端口复用");
        map.put(EGSRTP_UNKNOW, "未知错误");
    }

    public static String getErrorMsg(int code) {
        String message = map.get(code);
        return message != null ? message : "未知错误";
    }
}
